package com.ys.erp.entity.data.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author lwj
 * @date 2023/7/13
 */
    
@Data
@TableName(value = "t_coupon")
public class Coupon {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 券名字
     */
    @TableField(value = "coupon_name")
    private String couponName;

    /**
     * 优惠券类型，0满减券，1打折券，2赠送券
     */
    @TableField(value = "coupon_type")
    private Integer couponType;

    /**
     * 适用范围类型，0商品类别，1指定商品，2全场通用
     */
    @TableField(value = "suit_scope_type")
    private Integer suitScopeType;

    /**
     * 指定适用商品类别
     */
    @TableField(value = "suit_goods_category_ids")
    private String suitGoodsCategoryIds;

    /**
     * 适用商品
     */
    @TableField(value = "suit_goods_ids")
    private String suitGoodsIds;

    /**
     * 最小消费金额
     */
    @TableField(value = "min_fee")
    private Long minFee;

    /**
     * 满减优惠金额
     */
    @TableField(value = "preferential_money")
    private Long preferentialMoney;

    /**
     * 折扣（百分比）
     */
    @TableField(value = "discount")
    private Integer discount;

    /**
     * 赠送商品规格id
     */
    @TableField(value = "give_goods_specs_ids")
    private String giveGoodsSpecsIds;

    /**
     * 0:领取后N天有效，1：时间段有效
     */
    @TableField(value = "valid_type")
    private Integer validType;

    /**
     * 有效天数
     */
    @TableField(value = "valid_days")
    private Integer validDays;

    /**
     * 有效起始时间
     */
    @TableField(value = "valid_start_time")
    private LocalDateTime validStartTime;

    /**
     * 有效结束时间
     */
    @TableField(value = "valid_end_time")
    private LocalDateTime validEndTime;

    /**
     * 优惠卷商品可用类型
     */
    @TableField("goods_type")
    private Integer goodsType;


    /**
     * 排序
     */
    @TableField(value = "order_num")
    private Integer orderNum;

    /**
     * 券描述
     */
    @TableField(value = "coupon_describe")
    private String couponDescribe;

    @TableField(value = "version")
    @Version
    private Integer version;

    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @TableField(value = "update_time", update = "now()")
    private LocalDateTime updateTime;
}